var setting = {
    view: {
        selectedMulti: false,
		showLine: false
    },
    check: {
        enable: false
    },
    data: {
        simpleData: {
            enable: true
        }
    },
    edit: {
        enable: false
    },
    callback: {
		onDblClick: DblClick
	}
};

var zNodes = [];

function initTree(){
	$.post("/system/menu/findAllJson.do",{},function (data){
		var json = eval(data.result);
		zNodes = json;
		$.fn.zTree.init($("#tree"), setting, zNodes);
	});
}

function DblClick(event, treeId, treeNode) {
	window.parent.window.setSingleCheckMenuTreeMenuId(treeNode.id);
	window.parent.window.setSingleCheckMenuTreeMenuName(treeNode.name);
	parent.layer.close(window.parent.window.getSingleCheckMenuTree());
};
$(function (){
	initTree();
	//btnClick();
});